package com.AX.mapper;


import com.AX.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

@Mapper
public interface LoginMapper {
    @Select("SELECT * FROM user " +
            "WHERE  username = #{username}" +
            "AND passward = #{passward}")
    User findUser(String username,String passward);

    @Insert("INSERT INTO user (username, passward, number) " +
            "VALUES (#{username}, #{passward}, #{number})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    void insert(User user);
}
